<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>

    <script>


        var fruit = prompt("您想要什水果？\r苹果，榴莲，香蕉。");

        switch (fruit) {
            case "苹果":
                alert("苹果是2元/斤。");
                break;

            case "榴莲":
                alert("榴莲是10元/斤。");
                break;

            case "香蕉":
                alert("香蕉是5元/斤。");
                break;

            default:
                alert("本店没有其他水果！")
                break;
        }
    </script>
</head>

<body>

</body>

</html>